package com.china.school.pojo;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;

public class Todo {
    public void before(){
        System.out.println("------before---------");
    }
    public void after(){
        System.out.println("------after---------无论是否异常，都会执行");
    }
    public void around(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("------around---前------" + joinPoint.getClass());

        if(joinPoint.getArgs().length == 0){

            joinPoint.proceed( );
        }else {
            joinPoint.proceed(  );

        }
        System.out.println("------around-----后----" + joinPoint.getClass());

    }


    public void returning( ){
        System.out.println("------after-returning---------方法正常结束执行");
    }
    public void throwing(){
        System.out.println("------after-throwing---------抛出异常才执行");
    }


}
